#ifndef MAP_H
#define MAP_H

#include "basewindow.h"
#include <QWidget>
#include <QFileDialog>
#include <QMessageBox>
#include <QTextStream>
#include <iostream>
using namespace std;

class Map : public QWidget
{
    Q_OBJECT
public:
    Map(QWidget *parent = 0, int newX = 0, int newY = 0, QString filepath = "", QString newUsername = "Anonymous");
    void addCube(double newX, double newY, double newZ, int newSize, int color);
    int speed;
    int x, y;
    bool up, down, left, right;
    int counter;
    int counter2;
    int startSpeed;
    QString username;

    QString filepath;

    QImage *background;

    //Ship data
    int shipWidth;
    int shipHeight;
    int shipOffset;

    void camUpdate();
    void drawTunnel(QPainter *painter);    
    void loadCubes();

    //persistence
    void getMap();
    void saveMap();
    void loadMap();
};

#endif // MAP_H

